/*
 * program read data from file to buffer and them replace tabs
 * on the \t
 */

#include <stdio.h>

int main (int argc, const char** argv)
{
    FILE * source;
    char buffer[100];
    char array[1000];
    int i, j;
    source = fopen(argv[1], "r");
    if (source == NULL){
        perror ("Error opening file");
    }else {
        while (!feof(source)){
            if (fgets (buffer, 100, source) != NULL){
                fputs (buffer, stdout);
                    printf("%c",'\n');
                    for (i = 0, j= 0; buffer[i] != '\0' || i <= 100; ++i, ++j){
                        if (buffer[i] == '\t'){
                            array[j] = 't';
                        } else
                            array[j] = buffer[i];
                    }
                fputs (array, stdout);
            }
        }
        fclose(source);
    }
    return 0;
}

    
